package com.example.shop.mine

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import com.example.base.entity.CarEntity
import com.example.base.mvvm.BaseViewFragment
import com.example.shop.R
import com.example.shop.adapter.PayedOrderAdapter
import com.example.shop.adapter.PayingOrderAdapter
import com.example.shop.databinding.FragmentPayedBinding
import com.example.shop.db.AppDbUtils


class PayedFragment : BaseViewFragment<FragmentPayedBinding>() {
    // TODO: Rename and change types of parameters
    val list = mutableListOf<CarEntity>()
    lateinit var payedOrderAdapter: PayedOrderAdapter
    override fun initView() {
        payedOrderAdapter = PayedOrderAdapter(list)
        binding.rvPayed.adapter = payedOrderAdapter
        binding.rvPayed.layoutManager = LinearLayoutManager(context)
        list.clear()
        list.addAll(AppDbUtils.getAppDb().getOrderDao().queryOrder(2))
        payedOrderAdapter.notifyDataSetChanged()

    }

    override fun initData() {

    }

    override fun getLayout(): Int = R.layout.fragment_payed
}